<?php

namespace App\Console\Commands;

use App\Toutiao;
use Illuminate\Console\Command;

class Send extends Command
{
    protected  $key=[
        'zhongheng'=> [
            'token'=>'abe755fa242957df6607d00f6a584b77d5306b95',
            'key'=>'TUFGNk9NR1dRT0U0',
            'project_id'=>3
        ],
        'huatengB'=> [
            'token'=>'78cf74ef13ae5febd7e2be9bc4c7580354a892f6',
            'key'=>'NUc3N0xEVTNER0pH',
            'project_id'=>6
        ],
        'huatengB2'=> [
            'token'=>'b883f44d2245255df9eedd458acaf4497f0f1af4',
            'key'=>'SU82U1lRTkxSU1hY',
            'project_id'=>6
        ],
        'huatengB1'=> [
            'token'=>'5be4b0667a394ec974c15b7599b79d6e035b432b',
            'key'=>'N0hXRUtGNUQ0VURL',
            'project_id'=>6
        ],

        'huatengA'=> [
            'token'=>'3ad3640cdb9dd859ee25d1b072c6a3fbc54fb98d',
            'key'=>'RDhTNTZYVzZPTTc2',
            'project_id'=>5
        ],
        'huatengA1'=> [
            'token'=>'9f2c7d48e7bce13d8385e571ac16b52a86e35dc6',
            'key'=>'SzlPTkRYT1dUQTky',
            'project_id'=>5
        ],
        'huatengA2'=> [
            'token'=>'e5c8a1aa04dc70f75eb0e9ac837663df824be89c',
            'key'=>'SlRRVEZJMUJISU00',
            'project_id'=>9,
        ],
        'weihe'=>[
            'token'=>'bce15cfce979d374422fa788933937dda951bc35',
            'key'=>'SVlMTEZKVzhFRkdH',
            'project_id'=>9,
        ]
    ];
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:name';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        foreach ($this->key as $k=>$item){
           $toutiao= new Toutiao();
            $toutiao->key=$item['key'];
            $toutiao->token=$item['token'];
            $toutiao->project_id=$item['project_id'];
            $toutiao->save();
        }
    }
}
